﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" ValidateRequest="false"
    CodeBehind="Product_Info.aspx.cs" Inherits="TimKen.Web.Admin.Product.Product_Info" %>

<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<%@ Register TagPrefix="ux" Src="~/UserControls/DropDownCategoryList.ascx" TagName="DropDownCategoryList" %>


<asp:Content ID="Content3" ContentPlaceHolderID="ContentLinkAction" runat="server">
    <span class="action-span"><a href="Product_List.aspx">
        <%=GetLangString("MenuProductList")%></a></span>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    <%=GetLangString("ProductInfo")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">
    <div class="tab-div">
        <!-- tab bar -->
        <div id="tabbar-div">
            <p>
                <span class="tab-front" id="general-tab">
                    <%=GetLangString("BaseInfo")%></span><span class="tab-back" id="detail-tab"><%=GetLangString("DetailDescription")%></span><span
                        class="tab-back" id="mix-tab"><%=GetLangString("OtherInfo")%></span>
                        <span class="tab-back"
                            id="properties-tab"><%=GetLangString("Option")%></span>                         
            </p>
        </div>
        <!-- tab body -->
        <div id="tabbody-div">
           <!--基本信息：-->
            <table id="general-table" class="narrow-table">
                <tr>
                    <th>
                        <%=GetLangString("ItemCode")%>：<asp:HiddenField ID="txtProductID" runat="server" />
                    </th>
                    <td>
                        <asp:Label ID="txtItemCode" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("ProductName")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtProductName" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("BrandName")%>：
                    </th>
                    <td>
                       <asp:DropDownList  ID="ddlBrand"  runat="server"></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%=GetLangString("BasicPrice")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtBasicPrice" runat="server" Text=""></asp:Label>
                        <span onclick="ShowDiffPrice();" class="handcursor">
                            <%=GetLangString("DiffPrice")%></span>
                    </td>
                    <th>
                        <%=GetLangString("Currency")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtCurrency" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("TaxRate")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtTaxRate" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%=GetLangString("InvQty")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtInvQty" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("BaseUnit")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtBaseUnit" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("SalesUnit")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtSalesUnit" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%=GetLangString("Valid")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtVaild" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("ValidFrom")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtValidFrom" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("VailTo")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtVailTo" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%=GetLangString("Freeze")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtFreeze" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("FreezeFrom")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtFreezeFrom" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("FreezeTo")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtFreezeTo" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%=GetLangString("Weight")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtWeight" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("DateAdded")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtDateAdded" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("LastModified")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtLastModified" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                    </th>
                    <td>
                    </td>
                </tr>
                
                   <tr>
                    <th>
                        <%=GetLangString("MinNumber")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtMinNumber" runat="server" Text=""></asp:Label>
                    </td>
                    <th>
                        <%=GetLangString("MinMultiple")%>：
                    </th>
                    <td>
                        <asp:Label ID="txtMinMultiple" runat="server" Text=""></asp:Label>
                    </td>
                   <th>
                        <%=GetLangString("Recommend")%>：
                    </th>
                    <td>
                        <asp:CheckBox  ID="cbRecommend"  runat="server"   BorderWidth="0" />
                    </td>
                    <th>
                    </th>
                    <td>
                    </td>
                </tr>
            </table>
            <!-- 详细描述 -->
            <table width="90%" id="detail-table" style="display: none">
                <tr>
                    <td>
                        <FCKeditorV2:FCKeditor ID="fckContent" runat="server" AutoDetectLanguage="false"
                            Height="400">
                        </FCKeditorV2:FCKeditor>
                    </td>
                </tr>
            </table>             
            <!-- 其他信息 -->
            <table width="90%" id="mix-table" style="display: none" align="center">
                <tr>
                    <td colspan="2">
                       
                        <%=GetLangString("TechnicalDocument")%> ：<font color="red">支持多份材料，采用逗号分隔</font>
                    </td>
                    <td>
                        <asp:TextBox ID="txtIntroDocFile" runat="server"   TextMode="MultiLine"  Width="200" Rows="5"></asp:TextBox>
                    </td>
                </tr>
                
                <tr >
                <td colspan="3"    style="display:none" >
                 <asp:FileUpload ID="fuProductImage" runat="server" Height="20px" />
                 <asp:Button ID="btnUpload" runat="server" CssClass="button" OnClick="btnUpload_Click" /><br /> 
    
               <asp:Button ID="btnDelete" runat="server" CssClass="button" OnClick="btnDelete_Click" /><br /> 
                <asp:Image Width="200" Height="200" ID="imgProductImage" runat="server" />
                </td>
                </tr>
            </table>
            <!-- 商品属性 -->
            <table width="90%" id="properties-table" style="display: none" align="center">
                <tr>
                    <td colspan="2" align="center">
                        <div class="main-div">
                            <%=GetLangString("ChooseCategory")%>：
                            <asp:DropDownList ID="ddlCategory" runat="server" onchange="getAttributes()">
                            </asp:DropDownList>
                        </div>
                        <div id="tdAttributeList" class="form-div">
                        </div>
                    </td>
                </tr>
            </table>       
           
            
            
            
            <div id="DiffPrice" class="list-div" style="visibility: hidden; position: absolute;
                z-index: 5; width: 200px;">
                <span onclick="HiddenDiffPrice();" class="right list-div handcursor">close</span>
                <asp:Label ID="lbDiffPrice" runat="server" Text=""></asp:Label>
            </div>
            <div class="button-div">
                <asp:Button Text="" runat="server" CssClass="button" ID="btnSubmit" Width="50px"
                    OnClick="btnSubmit_Click" />
            </div>
        </div>
    </div>
    <div style="display: none">
        <asp:TextBox ID="txtActionID" runat="server"></asp:TextBox>
    </div>

    <script type="text/javascript">
        var txtActionField = document.getElementById('<%=this.txtActionID.ClientID%>');
    </script>

    <script src="../js/tab.js" type="text/javascript"></script>

    <script type="text/javascript">
    window.onload = function() {
    if(txtActionField.value!=""){
    var actionTab = document.getElementById(txtActionField.value);
    Change(actionTab);
    }
  
        $.ajax({
            url: '../Ajax/TypeOption.ashx?ProductID=<%=ProductID%>&time=<%=DateTime.Now.Ticks.ToString()%>',
            type: 'GET',
            timeout: 8000,
            cache:false,
            error: function() {
                alert('<%=GetLangString("LoadOptionError")%>');
            },
            success: function(html) {
                document.getElementById("tdAttributeList").innerHTML = html;
            }
        });
    }

       function ShowDiffPrice() {
            var d = document.getElementById('DiffPrice');
            d.style.visibility = "";
            d.style.zIndex = 10;
            d.style.top = window.event.clientY;
            d.style.left = event.clientX;
        }
        function HiddenDiffPrice() {
            var d = document.getElementById('DiffPrice');
            d.style.visibility = "hidden";
        }

    function getAttributes() {
        var CategoryID = document.getElementById('<%=this.ddlCategory.ClientID%>').value;
        
        $.ajax({
            url: '../Ajax/TypeOption.ashx?CategoryID=' + CategoryID+"&time=<%=DateTime.Now.Ticks.ToString()%>",
            type: 'GET',
            timeout: 8000,
            error: function() {
                alert("<%=GetLangString("LoadOptionError")%>");
            },
            success: function(html) {
                document.getElementById("tdAttributeList").innerHTML = html;
            }
        });
    }
    </script>

    <script type="text/javascript">
        function ShowDiffPrice() {
            var d = document.getElementById('DiffPrice');
            d.style.visibility = "";
            d.style.zIndex = 10;
            d.style.top = window.event.clientY;
            d.style.left = event.clientX;

        }
        function HiddenDiffPrice() {
            var d = document.getElementById('DiffPrice');
            d.style.visibility = "hidden";
        }


        function SChange(strSource) {
            var scn, sen, source;
            if (strSource.indexOf("cn", 0) > 0) {
                scn = strSource;
                sen = strSource.replace("cn", "en");
                source = "cn";
            }
            else {
                sen = strSource;
                scn = strSource.replace("en", "cn");
                source = "en";
            }

            var cn = document.getElementById(scn);
            var en = document.getElementById(sen);

            //中英文控件都存在
            if (cn && en) {
                var index = 0, value;
                var sibling;
                if (source == "cn") {
                    index = cn.selectedIndex;
                    value = cn.options[index].value;
                    sibling = en;
                } else {
                    index = en.selectedIndex;
                    value = cn.options[index].value;
                    sibling = cn;
                }

                for (var i = 0; i < sibling.options.length; i++) {
                    if (sibling.options[i].value == value) {
                        sibling.selectedIndex = i;
                    }
                }
            }

        }
    </script>

</asp:Content>
